package com.hs.srm.admin.modules.abnormalquality.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 品质异常审核记录
 *
 * @author ych
 * @since 2020-04-13 11:25:12
 */
@Data
@TableName("abnormal_audit_record")
public class AbnormalAuditRecordEntity implements Serializable {

    private static final long serialVersionUID = 193657920887699160L;

    public AbnormalAuditRecordEntity() {
    }

    public AbnormalAuditRecordEntity(Integer auditResult, String abnormalId, String name, Date date) {
        this.auditResult = auditResult;
        this.abnormalId = abnormalId;
        this.creator = name;
        this.createTime = date;
    }

    public AbnormalAuditRecordEntity(Integer auditResult, String abnormalId, String name, Date date, String auditComment) {
        this.auditResult = auditResult;
        this.abnormalId = abnormalId;
        this.creator = name;
        this.createTime = date;
        this.auditComment = auditComment;
    }

    @TableId(value = "pk_id", type = IdType.UUID)
    @TableField("pk_id")
    private String pkId;

    /**
     * 审批记录关联的异常单id
     */
    @TableField("abnormal_id")
    private String abnormalId;

    /**
     * 审核结果:0，待提交；1，审核中；2，审核通过；-1，审核驳回
     */
    @TableField("audit_result")
    private Integer auditResult;

    /**
     * 审批备注
     */
    @TableField("audit_comment")
    private String auditComment;

    /**
     * 创建人
     */
    @TableField("creator")
    private String creator;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

}